home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / STDN100.ZIP / STARDOWN.MEX < prev   
Encoding:
Text File  |  1996-02-18  |  2.6 KB  |  94 lines

  1. /////////////////////////////////////////////////////////////////////////
  2. //
  3. // StarDown V1.00 - (!)1996 Larry Monte\StarLab Systems Software
  4. //
  5. // MEX: Copyright 1990, 1995 by Lanius Corporation.  All rights reserved.
  6. //
  7. // DownLoad Command Replacement. Allows local users (sysops) to specify a
  8. // path to extract tagged files to.
  9. //
  10. //
  11.  
  12. #include <max.mh>
  13.  
  14. #define DEFAULT_PATH  "C:\\ATEMP\\"
  15.  
  16. // struct _instancedata: id;
  17.  
  18. void main()
  19. {
  20.   int: fnum, flags, pos, qsize, ok;
  21.   long: fsize, txtime;
  22.   char: nonstop;
  23.   string: rootname, filescheck, added_filename, new_path, out_path;
  24.  
  25.   ok := 0;
  26.  
  27.   if (id.local = TRUE)
  28.   {
  29.     print("\n");
  30.     reset_more(nonstop);
  31.     qsize := (tag_queue_size());
  32.     for (fnum := 0; fnum < qsize AND do_more(nonstop, COL_CYAN);
  33.          fnum := fnum + 1)
  34.     {
  35.       tag_get_name( fnum, flags, filescheck);
  36.       pos := strridx(filescheck, 0, '\\');
  37.       if (pos=0)
  38.         rootname := filescheck;
  39.       else
  40.         rootname := substr(filescheck, pos+1, strlen(filescheck)-pos+1);
  41.       fsize := filesize(filescheck);
  42.       print("\x16\x01\x0e(", fnum+1, ") \x16\x01\x0d"+strpad(
  43.             rootname,16,' '), ' ', "\x16\x01\x0a("+ltostr(fsize)+
  44.             " Bytes)\n");
  45.     }
  46.     while (ok = 0)
  47.     {
  48.       qsize := (tag_queue_size());
  49.       print(COL_WHITE, "\nFile(s) To DownLoad(#",qsize+1,"): ");
  50.       input_str(added_filename, INPUT_WORD,0,14,"");
  51.       if (added_filename <> "" AND added_filename <> "/q")
  52.       {
  53.         input := "A;"+added_filename;
  54.         menu_cmd(512,"");
  55.       }
  56.       else if (tag_queue_size() > 0 AND added_filename <> "/q")
  57.       {
  58.         print(COL_YELLOW, "Altername Path, Or <ENTER> For Default",
  59.              "(Include Trailing BackSlash)\n : ");
  60.         input_str(new_path,INPUT_WORD,0,80,"");
  61.         if (new_path <> "")
  62.           out_path := new_path;
  63.         else
  64.           out_path := DEFAULT_PATH;
  65.         qsize := (tag_queue_size());
  66.         for (fnum := 0; fnum < qsize; fnum := fnum +1)
  67.         {
  68.           tag_get_name( fnum, flags, filescheck);
  69.           pos := strridx(filescheck, 0, '\\');
  70.           if (pos=0)
  71.             rootname := filescheck;
  72.           else
  73.             rootname := substr(filescheck, pos+1,
  74.                         strlen(filescheck)-pos+1);
  75.           filecopy(filescheck,out_path+rootname);
  76.         }
  77.         input := "C;|";
  78.         menu_cmd(512,"");
  79.         ok := 1;
  80.       }
  81.       else if (added_filename = "\e")
  82.       {
  83.         menu_cmd(512,"");
  84.       }
  85.       else
  86.         ok := 1;
  87.     }
  88.   }
  89.   else
  90.   {
  91.     menu_cmd(505,"");
  92.   }
  93. }
  94.